def bin_to_dec():
	q = raw_input("is your number a binary or decimal number?")
	if q.lower() == "binary" or q.lower() == "bin":
		b = raw_input('please input the binary number')
		print int(b, 2)
	elif q.lower() == "decimal" or q.lower() == "dec":
		d = input('please input the decimal number')
		print bin(d)
	else:
		print "Sorry, the number type is not recognized"
		bin_to_dec()
	repeat = raw_input("Would you like to go again?")
	if repeat == "yes":
		bin_to_dec()
	else:
		return False


bin_to_dec()